import redis
from setting import *
from utils.log import logger


class RedisQueue:
    @staticmethod
    def connect():
        try:
            pool = redis.ConnectionPool(host=REDIS_HOST, password=REDIS_PASSWORD, decode_responses=True)
            conn = redis.Redis(connection_pool=pool)
            return conn
        except Exception as err:
            logger.error(err)
